package org.scs.carleton.ca.pgdt.core.internal.parser;

import org.scs.carleton.ca.pgdt.core.parser.nodes.IASTNumber;
import org.scs.carleton.ca.pgdt.core.visitor.PrologVisitor;

/**
 * The physical node for a prolog number
 * 
 * @author tessierj
 *
 */
public class ASTNumber extends ASTNode implements IASTNumber {
	private Number value;
	
	public ASTNumber(ASTTranslationUnit translationUnit, int type, Number number) {
		super(translationUnit, type);
		value = number;
	}

	@Override
	public Number getValue() {
		return value;
	}
	
	@SuppressWarnings("nls")
	public String toString() {
		return "Number: " + value + " from " + getStartOffset() + " to " + getEndOffset();
	}
	
	@Override
	public boolean accept(PrologVisitor visitor) {
		return visitor.visit(this);
	}
}
